home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-10-05 | 1.3 KB | 44 lines | [TEXT/GEOL] |
- Item 6889457 5-Oct-89 10:19
-
- From: KNEPPER Knepper, Christopher
-
- To: LANGSTON1 Langston, Jeff,CLA
-
- cc: MACAPP.TECH$ MACAPP Tech
-
- Sub: Re: DoRead, DoWrite request
-
- Phil,
-
- In response to your enhancement request:
-
- >My request is that both DoRead and DoWrite have the resource fork reference
- >number passed in.
-
- I disagree. I don't think that either DoRead or DoWrite should pass in the ref
- num of the res fork. The reason I disagree is that you don't need it. As long
- as you call IDocument "correctly" from I<your app>Document, the resource fork
- of the file will be open when DoRead or DoWrite are called:
-
- IDocument(kFileType, kSignature, kUsesDataFork, kUsesRsrcFork, kDataOpen,
- kRsrcOpen);
-
- Here's some code that I use in my DoWrite to add a resource to the file:
-
- { since the resource fork is open, I can add a resource }
- h := CreateViewRsrcHandle(fMyView);
- FailNIL(h);
- AddResource(h, 'view', kMyID, 'MyView');
- FailResError;
- SetResAttrs(h,resPurgeable);
- ChangedResource(h);
- WriteResource(h);
- UpdateResFile(fRsrcRefnum);
-
- Note that "CreateViewRsrcHandle" is a nifty routine developed by Joost Kemink
- that takes a handle to a TView object (or a subclass of TView) and returns a
- handle to a 'view' resource.
-
- -Chris
-
-